/*
 * Generated file. 
 * 
 * Response.java
 */
package xsp;

import com.ibm.xsp.page.compiled.AbstractCompiledPage;
import com.ibm.xsp.page.compiled.AbstractCompiledPageDispatcher;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import com.ibm.xsp.page.compiled.NoSuchComponentException;
import com.ibm.xsp.page.compiled.PageExpressionEvaluator;
import java.lang.String;
import java.lang.Object;
import java.lang.Integer;
import com.ibm.xsp.model.domino.DominoDocumentData;
import javax.faces.el.MethodBinding;
import javax.faces.el.ValueBinding;
import com.ibm.xsp.component.FacesDataProvider;
import com.ibm.xsp.component.UIViewRootEx2;
import java.lang.Boolean;
import com.ibm.xsp.extlib.component.mobile.UIDMHeading;
import com.ibm.xsp.extlib.component.mobile.UIToolBarButton;
import com.ibm.xsp.component.xp.XspEventHandler;
import com.ibm.xsp.actions.ActionGroup;
import com.ibm.xsp.extlib.actions.MoveToAction;
import com.ibm.xsp.component.xp.XspLineBreak;
import com.ibm.xsp.component.xp.XspOutputLabel;
import com.ibm.xsp.extlib.component.data.UIFormTable;
import com.ibm.xsp.extlib.component.data.UIFormLayoutRow;
import com.ibm.xsp.component.xp.XspInputText;
import com.ibm.xsp.component.xp.XspInputTextarea;
import com.ibm.xsp.component.xp.XspInputRichText;
import com.ibm.xsp.component.UIPanelEx;
import com.ibm.xsp.component.xp.XspOutputLink;
import com.ibm.xsp.component.xp.XspGraphicImage;
import com.ibm.xsp.component.xp.XspFileDownload;
import com.ibm.xsp.component.xp.XspFileUpload;
import com.ibm.xsp.component.xp.XspCommandButton;
import com.ibm.xsp.complex.Attr;
import com.ibm.xsp.actions.SaveAction;
import java.util.Map;

@SuppressWarnings("all")
public class Response extends AbstractCompiledPageDispatcher{

    private static final String[][] s_libraryVersions = new String[][]{
        {"com.ibm.xsp.extlib.library", "8.5.32006"},  // version of "xe:toolBarButton"
    };
    
    public Response() {
        super("8.5.3"); // version of xp:button attrs
    }

    protected String[][] getLibraryTagVersions() {
        return s_libraryVersions;
    }

    protected AbstractCompiledPage createPage(int pageIndex) {
        return new ResponsePage();
    }
    
    protected boolean isCustomControl() {
        return true;
    }

    public static class ResponsePage extends AbstractCompiledPage {
        
        private static final ComponentInfo[] s_infos = new ComponentInfo[]{
            ComponentInfo.EMPTY_NORMAL, // 0 eventHandler
            new ComponentInfo(false, new int[]{0}), // 1 "button3"
            new ComponentInfo(false, null, // 2 "djxmheading1"
              new Object[][]{
                new Object[]{"actionFacet", Integer.valueOf(1)},
              } ),
            ComponentInfo.EMPTY_NORMAL, // 3 br
            ComponentInfo.EMPTY_NORMAL, // 4 label
            ComponentInfo.EMPTY_NORMAL, // 5 "inputtext15"
            new ComponentInfo(false, new int[]{5}), // 6 "formrow9"
            ComponentInfo.EMPTY_NORMAL, // 7 "inputtext5"
            ComponentInfo.EMPTY_NORMAL, // 8 label2
            new ComponentInfo(false, new int[]{7, 8}), // 9 "formrow10"
            ComponentInfo.EMPTY_NORMAL, // 10 "documentbody"
            new ComponentInfo(false, new int[]{10}), // 11 "formrow11"
            ComponentInfo.EMPTY_NORMAL, // 12 "rtbody"
            new ComponentInfo(false, new int[]{12}), // 13 "formrow1"
            new ComponentInfo(false, new int[]{6, 9, 11, 13}), // 14 "formtable3"
            ComponentInfo.EMPTY_NORMAL, // 15 "eventhandler4"
            ComponentInfo.EMPTY_NORMAL, // 16 "image2"
            new ComponentInfo(false, new int[]{15, 16}), // 17 "link1"
            ComponentInfo.EMPTY_NORMAL, // 18 "filedownload1"
            new ComponentInfo(false, new int[]{17, 18}), // 19 "panel1"
            ComponentInfo.EMPTY_NORMAL, // 20 br2
            ComponentInfo.EMPTY_NORMAL, // 21 eventHandler2
            new ComponentInfo(false, new int[]{21}), // 22 "fileupload"
            new ComponentInfo(false, new int[]{20, 22}), // 23 "filecontainer"
            ComponentInfo.EMPTY_NORMAL, // 24 br3
            ComponentInfo.EMPTY_NORMAL, // 25 br4
            ComponentInfo.EMPTY_NORMAL, // 26 eventHandler3
            new ComponentInfo(false, new int[]{26}), // 27 "button2"
            ComponentInfo.EMPTY_NORMAL, // 28 "linkcancel"
            new ComponentInfo(false, new int[]{27, 28}), // 29 "panel16"
            new ComponentInfo(false, new int[]{2, 3, 4, 14, 19, 23, 24, 25, 29}), // 30 view
        };
        
        public ResponsePage() {
            super(30, s_infos );
        }
        
        public int getComponentForId(String id) throws NoSuchComponentException { 
            if( "djxmheading1".equals(id) )
                return 2;
            if( "button3".equals(id) )
                return 1;
            if( "formtable3".equals(id) )
                return 14;
            if( "formrow9".equals(id) )
                return 6;
            if( "inputtext15".equals(id) )
                return 5;
            if( "formrow10".equals(id) )
                return 9;
            if( "inputtext5".equals(id) )
                return 7;
            if( "formrow11".equals(id) )
                return 11;
            if( "documentbody".equals(id) )
                return 10;
            if( "formrow1".equals(id) )
                return 13;
            if( "rtbody".equals(id) )
                return 12;
            if( "panel1".equals(id) )
                return 19;
            if( "link1".equals(id) )
                return 17;
            if( "eventhandler4".equals(id) )
                return 15;
            if( "image2".equals(id) )
                return 16;
            if( "filedownload1".equals(id) )
                return 18;
            if( "filecontainer".equals(id) )
                return 23;
            if( "fileupload".equals(id) )
                return 22;
            if( "panel16".equals(id) )
                return 29;
            if( "button2".equals(id) )
                return 27;
            if( "linkcancel".equals(id) )
                return 28;
            return -1;
        }
        
        public UIComponent createComponent(int id, FacesContext context,
                UIComponent parent, PageExpressionEvaluator evaluator)
                throws NoSuchComponentException { 
            switch (id) {
            case 30:
                return createView(context, parent, evaluator);
            case 2:
                return createDjxmheading1(context, parent, evaluator);
            case 1:
                return createButton3(context, parent, evaluator);
            case 0:
                return createEventHandler(context, parent, evaluator);
            case 3:
                return createBr(context, parent, evaluator);
            case 4:
                return createLabel(context, parent, evaluator);
            case 14:
                return createFormtable3(context, parent, evaluator);
            case 6:
                return createFormrow9(context, parent, evaluator);
            case 5:
                return createInputtext15(context, parent, evaluator);
            case 9:
                return createFormrow10(context, parent, evaluator);
            case 7:
                return createInputtext5(context, parent, evaluator);
            case 8:
                return createLabel2(context, parent, evaluator);
            case 11:
                return createFormrow11(context, parent, evaluator);
            case 10:
                return createDocumentbody(context, parent, evaluator);
            case 13:
                return createFormrow1(context, parent, evaluator);
            case 12:
                return createRtbody(context, parent, evaluator);
            case 19:
                return createPanel1(context, parent, evaluator);
            case 17:
                return createLink1(context, parent, evaluator);
            case 15:
                return createEventhandler4(context, parent, evaluator);
            case 16:
                return createImage2(context, parent, evaluator);
            case 18:
                return createFiledownload1(context, parent, evaluator);
            case 23:
                return createFilecontainer(context, parent, evaluator);
            case 20:
                return createBr2(context, parent, evaluator);
            case 22:
                return createFileupload(context, parent, evaluator);
            case 21:
                return createEventHandler2(context, parent, evaluator);
            case 24:
                return createBr3(context, parent, evaluator);
            case 25:
                return createBr4(context, parent, evaluator);
            case 29:
                return createPanel16(context, parent, evaluator);
            case 27:
                return createButton2(context, parent, evaluator);
            case 26:
                return createEventHandler3(context, parent, evaluator);
            case 28:
                return createLinkcancel(context, parent, evaluator);
            }
            throw new NoSuchComponentException(id);
        }
        
        protected void initIncluderAsRoot(FacesContext context,
                PageExpressionEvaluator evaluator, UIComponent root) {
            DominoDocumentData data = new DominoDocumentData();
            data.setComponent(root);
            String sourceId = "/xp:view[1]/xp:this.data[1]/xp:dominoDocument[1]/xp:this.querySaveDocument[1]/text()";
            MethodBinding querySaveDocument = evaluator.createMethodBinding(root,
                    "#{javascript:// store user CGI variables\nvar cgi = new CGIVariables();\nresponseDoc.replaceItemValue(\"Remote_User\", cgi.get(\"REMOTE_USER\"));\nresponseDoc.replaceItemValue(\"Remote_Addr\", cgi.get(\"REMOTE_ADDR\"));\ncgi = null;}",
                    null,null, sourceId);
            data.setQuerySaveDocument(querySaveDocument);
            data.setComputeWithForm("onsave");
            data.setIgnoreRequestParams(true);
            String sourceId2 = "/xp:view[1]/xp:this.data[1]/xp:dominoDocument[1]/@parentId";
            String parentIdExpr = "#{javascript:param.parentNoteID}";
            ValueBinding parentId = evaluator.createValueBinding(root, parentIdExpr, sourceId2,String.class);
            data.setValueBinding("parentId", parentId);
            data.setAction("newDocument");
            data.setVar("responseDoc");
            String sourceId3 = "/xp:view[1]/xp:this.data[1]/xp:dominoDocument[1]/xp:this.postNewDocument[1]/text()";
            MethodBinding postNewDocument = evaluator.createMethodBinding(root,
                    "#{javascript:\n// get the parent doc and check if the parent is a response or a main doc\nvar parent:NotesDocument = database.getDocumentByID(responseDoc.getParentId());\n//if(null != parent){\n\tvar isResponse:boolean = parent.isResponse();\n\t\n\tviewScope.parentSubject = parent.getItemValue(\"Subject\");\n\tviewScope.parentTags = parent.getItemValue(\"Categories\");\n\t\n\t// inherit these items from the parent doc into the response doc\n\tresponseDoc.setValue(\"MainID\", parent.getItemValue(\"MainID\"));\n\tresponseDoc.setValue(\"ParentSubject\", parent.getItemValue(\"Subject\"));\n\tresponseDoc.setValue(\"Readers\", parent.getItemValue(\"Readers\"));\n\tresponseDoc.setValue(\"ParentForm\", parent.getItemValue(\"Form\"));\n\tresponseDoc.setValue(\"ThreadId\", parent.getItemValue(\"ThreadId\"));\n\tresponseDoc.setValue(\"ExpireDate\", parent.getItemValue(\"ExpireDate\"));\n\tresponseDoc.setValue(\"Categories\", parent.getItemValue(\"Categories\"));\n\tresponseDoc.setValue(\"ImmediateParentSubject\", parent.getItemValue(\"Subject\"));\n\t\n\t// this item below depends on the type of parent...\n\tif (isResponse == false) {\n\t\tresponseDoc.setValue(\"OriginalSubject\", parent.getItemValue(\"Subject\"));\t\n\t} else {\n\t\tresponseDoc.setValue(\"OriginalSubject\", parent.getItemValue(\"OriginalSubject\"));\n\t}\n//}\n}",
                    null,null, sourceId3);
            data.setPostNewDocument(postNewDocument);
            data.setFormName("Response");
            FacesDataProvider asDataProvider = root instanceof FacesDataProvider ?
                    (FacesDataProvider) root : null;
            if( null != asDataProvider ){
                asDataProvider.addData(data);
            }
        }

        private UIComponent createView(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            UIViewRootEx2 result = new UIViewRootEx2();
            initViewRoot(result);
            DominoDocumentData data = new DominoDocumentData();
            data.setComponent(result);
            String sourceId = "/xp:view[1]/xp:this.data[1]/xp:dominoDocument[1]/xp:this.querySaveDocument[1]/text()";
            MethodBinding querySaveDocument = evaluator.createMethodBinding(result,
                    "#{javascript:// store user CGI variables\nvar cgi = new CGIVariables();\nresponseDoc.replaceItemValue(\"Remote_User\", cgi.get(\"REMOTE_USER\"));\nresponseDoc.replaceItemValue(\"Remote_Addr\", cgi.get(\"REMOTE_ADDR\"));\ncgi = null;}",
                    null,null, sourceId);
            data.setQuerySaveDocument(querySaveDocument);
            data.setComputeWithForm("onsave");
            data.setIgnoreRequestParams(true);
            String sourceId2 = "/xp:view[1]/xp:this.data[1]/xp:dominoDocument[1]/@parentId";
            String parentIdExpr = "#{javascript:param.parentNoteID}";
            ValueBinding parentId = evaluator.createValueBinding(result, parentIdExpr, sourceId2,String.class);
            data.setValueBinding("parentId", parentId);
            data.setAction("newDocument");
            data.setVar("responseDoc");
            String sourceId3 = "/xp:view[1]/xp:this.data[1]/xp:dominoDocument[1]/xp:this.postNewDocument[1]/text()";
            MethodBinding postNewDocument = evaluator.createMethodBinding(result,
                    "#{javascript:\n// get the parent doc and check if the parent is a response or a main doc\nvar parent:NotesDocument = database.getDocumentByID(responseDoc.getParentId());\n//if(null != parent){\n\tvar isResponse:boolean = parent.isResponse();\n\t\n\tviewScope.parentSubject = parent.getItemValue(\"Subject\");\n\tviewScope.parentTags = parent.getItemValue(\"Categories\");\n\t\n\t// inherit these items from the parent doc into the response doc\n\tresponseDoc.setValue(\"MainID\", parent.getItemValue(\"MainID\"));\n\tresponseDoc.setValue(\"ParentSubject\", parent.getItemValue(\"Subject\"));\n\tresponseDoc.setValue(\"Readers\", parent.getItemValue(\"Readers\"));\n\tresponseDoc.setValue(\"ParentForm\", parent.getItemValue(\"Form\"));\n\tresponseDoc.setValue(\"ThreadId\", parent.getItemValue(\"ThreadId\"));\n\tresponseDoc.setValue(\"ExpireDate\", parent.getItemValue(\"ExpireDate\"));\n\tresponseDoc.setValue(\"Categories\", parent.getItemValue(\"Categories\"));\n\tresponseDoc.setValue(\"ImmediateParentSubject\", parent.getItemValue(\"Subject\"));\n\t\n\t// this item below depends on the type of parent...\n\tif (isResponse == false) {\n\t\tresponseDoc.setValue(\"OriginalSubject\", parent.getItemValue(\"Subject\"));\t\n\t} else {\n\t\tresponseDoc.setValue(\"OriginalSubject\", parent.getItemValue(\"OriginalSubject\"));\n\t}\n//}\n}",
                    null,null, sourceId3);
            data.setPostNewDocument(postNewDocument);
            data.setFormName("Response");
            result.addData(data);
            return result;
        }

        private UIComponent createDjxmheading1(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            // loaded=??
            String loadedBnd = "#{javascript:isMobile()}";
            String sourceId = "djxmHeading1/@loaded";
            String loaded = evaluator.evaluateAsString(null, loadedBnd, sourceId, boolean.class);
            if ( null != loaded && loaded.length() > 0 &&
                    ! Boolean.parseBoolean(loaded) ) {
                return null;
            } // else loaded was true
            UIDMHeading result = new UIDMHeading();
            result.setLabel("Reply");
            result.setBack("Cancel");
            setId(result, "djxmHeading1");
            String sourceId2 = "djxmHeading1/@moveTo";
            String moveToExpr = "document#{javascript:sessionScope.backURL}";
            ValueBinding moveTo = evaluator.createValueBinding(result, moveToExpr, sourceId2,String.class);
            result.setValueBinding("moveTo", moveTo);
            return result;
        }

        private UIComponent createButton3(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            UIToolBarButton result = new UIToolBarButton();
            result.setLabel("Save");
            setId(result, "button3");
            return result;
        }

        private UIComponent createEventHandler(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspEventHandler result = new XspEventHandler();
            ActionGroup action = new ActionGroup();
            action.setComponent(result);
            MoveToAction actions = new MoveToAction();
            actions.setComponent(result);
            String sourceId = "button3/xp:eventHandler[1]/xp:this.action[1]/xp:actionGroup[1]/xe:moveTo[1]/xp:this.targetPage[1]/text()";
            String targetPageExpr = "#{javascript:\n\t\t\t\t\t\t\t\t\treturn \"document\" + sessionScope.backURL;\n\t\t\t\t\t\t\t\t}";
            ValueBinding targetPage = evaluator.createValueBinding(result, targetPageExpr, sourceId,String.class);
            actions.setValueBinding("targetPage", targetPage);
            actions.setForceFullRefresh(true);
            actions.setSaveDocument(true);
            actions.setTransitionType("slide");
            actions.setDirection("Left to Right");
            actions.setSourceReferenceId("button3/xp:eventHandler[1]/xp:this.action[1]/xp:actionGroup[1]/xe:moveTo[1]");
            action.addAction(actions);
            action.setSourceReferenceId("button3/xp:eventHandler[1]/xp:this.action[1]/xp:actionGroup[1]");
            result.setAction(action);
            result.setSubmit(true);
            result.setEvent("onclick");
            result.setRefreshMode("complete");
            return result;
        }

        private UIComponent createBr(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspLineBreak result = new XspLineBreak();
            return result;
        }

        private UIComponent createLabel(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            // loaded=??
            String loadedBnd = "#{javascript:!isMobile()}";
            String sourceId = "/xp:view[1]/xp:label[1]/@loaded";
            String loaded = evaluator.evaluateAsString(null, loadedBnd, sourceId, boolean.class);
            if ( null != loaded && loaded.length() > 0 &&
                    ! Boolean.parseBoolean(loaded) ) {
                return null;
            } // else loaded was true
            XspOutputLabel result = new XspOutputLabel();
            result.setValue("Reply");
            result.setStyleClass("xspComputedFieldHeaderSubtitle");
            return result;
        }

        private UIComponent createFormtable3(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            UIFormTable result = new UIFormTable();
            setId(result, "formTable3");
            result.setLegend("Create a reply");
            return result;
        }

        private UIComponent createFormrow9(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            UIFormLayoutRow result = new UIFormLayoutRow();
            result.setLabel("Subject");
            setId(result, "formRow9");
            return result;
        }

        private UIComponent createInputtext15(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspInputText result = new XspInputText();
            String sourceId = "inputText15/@value";
            String valueExpr = "#{responseDoc.Subject}";
            ValueBinding value = evaluator.createValueBinding(result, valueExpr, sourceId,Object.class);
            result.setValueBinding("value", value);
            result.setSize(15);
            String sourceId2 = "inputText15/@disableClientSideValidation";
            String disableClientSideValidationExpr = "#{javascript:!isMobile()}";
            ValueBinding disableClientSideValidation = evaluator.createValueBinding(result, disableClientSideValidationExpr, sourceId2,boolean.class);
            result.setValueBinding("disableClientSideValidation", disableClientSideValidation);
            result.setStyleClass("mblFormRowInput");
            setId(result, "inputText15");
            result.setRequired(true);
            return result;
        }

        private UIComponent createFormrow10(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            UIFormLayoutRow result = new UIFormLayoutRow();
            result.setLabel("Tags");
            setId(result, "formRow10");
            return result;
        }

        private UIComponent createInputtext5(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspInputText result = new XspInputText();
            String sourceId = "inputText5/@defaultValue";
            String defaultValueExpr = "#{javascript:viewScope.parentTags}";
            ValueBinding defaultValue = evaluator.createValueBinding(result, defaultValueExpr, sourceId,Object.class);
            result.setValueBinding("defaultValue", defaultValue);
            String sourceId2 = "inputText5/@value";
            String valueExpr = "#{responseDoc.WebCategories}";
            ValueBinding value = evaluator.createValueBinding(result, valueExpr, sourceId2,Object.class);
            result.setValueBinding("value", value);
            result.setStyle("display:none");
            result.setSize(15);
            result.setMultipleSeparator(",");
            setId(result, "inputText5");
            return result;
        }

        private UIComponent createLabel2(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspOutputLabel result = new XspOutputLabel();
            String sourceId = "formRow10/xp:label[1]/xp:this.style[1]/text()";
            String styleExpr = "#{javascript:\n\t\t\t\t\tif(isAndroidCheck())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn \"color:white\"\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn \"color:black\";\n\t\t\t\t\t}\n\t\t\t\t}";
            ValueBinding style = evaluator.createValueBinding(result, styleExpr, sourceId,String.class);
            result.setValueBinding("style", style);
            String sourceId2 = "formRow10/xp:label[1]/@value";
            String valueExpr = "#{viewScope.parentTags}";
            ValueBinding value = evaluator.createValueBinding(result, valueExpr, sourceId2,Object.class);
            result.setValueBinding("value", value);
            result.setFor("formRow10");
            return result;
        }

        private UIComponent createFormrow11(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            // loaded=??
            String loadedBnd = "#{javascript:isMobile()}";
            String sourceId = "formRow11/@loaded";
            String loaded = evaluator.evaluateAsString(null, loadedBnd, sourceId, boolean.class);
            if ( null != loaded && loaded.length() > 0 &&
                    ! Boolean.parseBoolean(loaded) ) {
                return null;
            } // else loaded was true
            UIFormLayoutRow result = new UIFormLayoutRow();
            result.setLabel(" ");
            setId(result, "formRow11");
            return result;
        }

        private UIComponent createDocumentbody(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspInputTextarea result = new XspInputTextarea();
            String sourceId = "documentBody/@value";
            String valueExpr = "#{responseDoc.Body}";
            ValueBinding value = evaluator.createValueBinding(result, valueExpr, sourceId,Object.class);
            result.setValueBinding("value", value);
            result.setHtmlFilter("acf");
            result.setDisableClientSideValidation(false);
            result.setRole("input");
            result.setStyleClass("mblFormRowTextArea");
            result.setTitle("enter text to document body");
            result.setHtmlFilterIn("acf");
            result.setRows(5);
            setId(result, "documentBody");
            result.setRequired(true);
            return result;
        }

        private UIComponent createFormrow1(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            // loaded=??
            String loadedBnd = "#{javascript:!isMobile()}";
            String sourceId = "formRow1/@loaded";
            String loaded = evaluator.evaluateAsString(null, loadedBnd, sourceId, boolean.class);
            if ( null != loaded && loaded.length() > 0 &&
                    ! Boolean.parseBoolean(loaded) ) {
                return null;
            } // else loaded was true
            UIFormLayoutRow result = new UIFormLayoutRow();
            setId(result, "formRow1");
            result.setLabelPosition("none");
            return result;
        }

        private UIComponent createRtbody(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspInputRichText result = new XspInputRichText();
            String sourceId = "rtBody/@value";
            String valueExpr = "#{responseDoc.Body}";
            ValueBinding value = evaluator.createValueBinding(result, valueExpr, sourceId,Object.class);
            result.setValueBinding("value", value);
            result.setRole("input");
            result.setTitle("enter text into document body");
            setId(result, "rtBody");
            return result;
        }

        private UIComponent createPanel1(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            // loaded=??
            String loadedBnd = "#{javascript:!isMobile()}";
            String sourceId = "panel1/@loaded";
            String loaded = evaluator.evaluateAsString(null, loadedBnd, sourceId, boolean.class);
            if ( null != loaded && loaded.length() > 0 &&
                    ! Boolean.parseBoolean(loaded) ) {
                return null;
            } // else loaded was true
            UIPanelEx result = new UIPanelEx();
            result.setStyleClass("attachFilePanel");
            setId(result, "panel1");
            return result;
        }

        private UIComponent createLink1(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspOutputLink result = new XspOutputLink();
            String sourceId = "link1/@style";
            String styleExpr = "float: #{javascript: context.isDirectionRTL() ? \'right\' : \'left\'};";
            ValueBinding style = evaluator.createValueBinding(result, styleExpr, sourceId,String.class);
            result.setValueBinding("style", style);
            result.setEscape(true);
            result.setRole("button");
            result.setStyleClass("attachFileLink");
            result.setTitle("expand area to attach a file to document");
            setId(result, "link1");
            result.setText(" Attach File");
            return result;
        }

        private UIComponent createEventhandler4(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspEventHandler result = new XspEventHandler();
            result.setSubmit(false);
            result.setEvent("onclick");
            String sourceId = "eventHandler4/xp:this.script[1]/text()";
            MethodBinding script = evaluator.createMethodBinding(result,
                    "var fileContainer = document.getElementById(\"#{id:fileContainer}\");\n\t\t\t\t\tvar upload = document.getElementById(\"#{id:fileUpload}\");\n\t\t\t\t\tif(null != fileContainer)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar displayStyle = fileContainer.style.height;\n\t\t\t\t\t\tif (!displayStyle || displayStyle == \"0px\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfileContainer.style.height = \'50px\';\n\t\t\t\t\t\t\tfileContainer.style.width = \'250px\';\n\t\t\t\t\t\t\tupload.style.height = \'25px\';\n\t\t\t\t\t\t\tupload.style.width = \'200px\';\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfileContainer.style.height = \'0px\';\n\t\t\t\t\t\t\tfileContainer.style.width = \'0px\';\n\t\t\t\t\t\t\tupload.style.height = \'0px\';\n\t\t\t\t\t\t\tupload.style.width = \'0px\';\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
                    null,null, sourceId);
            result.setScript(script);
            setId(result, "eventHandler4");
            return result;
        }

        private UIComponent createImage2(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspGraphicImage result = new XspGraphicImage();
            result.setAlt("Add Attachment");
            setId(result, "image2");
            result.setUrl("/xpAttachment.gif");
            return result;
        }

        private UIComponent createFiledownload1(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspFileDownload result = new XspFileDownload();
            String sourceId = "fileDownload1/@value";
            String valueExpr = "#{responseDoc.Body}";
            ValueBinding value = evaluator.createValueBinding(result, valueExpr, sourceId,Object.class);
            result.setValueBinding("value", value);
            String sourceId2 = "fileDownload1/@style";
            String styleExpr = "float: #{javascript: context.isDirectionRTL() ? \'left\' : \'right\'};";
            ValueBinding style = evaluator.createValueBinding(result, styleExpr, sourceId2,String.class);
            result.setValueBinding("style", style);
            result.setDisplayLastModified(false);
            result.setAllowDelete(true);
            result.setStyleClass("mainTopicDownload");
            result.setRows(30);
            setId(result, "fileDownload1");
            result.setHideWhen(true);
            return result;
        }

        private UIComponent createFilecontainer(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            // loaded=??
            String loadedBnd = "#{javascript:!isMobile()}";
            String sourceId = "fileContainer/@loaded";
            String loaded = evaluator.evaluateAsString(null, loadedBnd, sourceId, boolean.class);
            if ( null != loaded && loaded.length() > 0 &&
                    ! Boolean.parseBoolean(loaded) ) {
                return null;
            } // else loaded was true
            UIPanelEx result = new UIPanelEx();
            result.setRole("upload");
            result.setStyleClass("webFileContainer");
            result.setTitle("upload file with document");
            setId(result, "fileContainer");
            return result;
        }

        private UIComponent createBr2(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspLineBreak result = new XspLineBreak();
            return result;
        }

        private UIComponent createFileupload(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspFileUpload result = new XspFileUpload();
            String sourceId = "fileUpload/@value";
            String valueExpr = "#{responseDoc.Body}";
            ValueBinding value = evaluator.createValueBinding(result, valueExpr, sourceId,Object.class);
            result.setValueBinding("value", value);
            result.setRole("upload");
            result.setStyleClass("webFileContainerUpload");
            result.setTitle("upload a file");
            setId(result, "fileUpload");
            return result;
        }

        private UIComponent createEventHandler2(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspEventHandler result = new XspEventHandler();
            String sourceId = "fileUpload/xp:eventHandler[1]/xp:this.action[1]/text()";
            MethodBinding action = evaluator.createMethodBinding(result,
                    "#{javascript:// kick off round-trip...}",
                    null,null, sourceId);
            result.setAction(action);
            result.setSubmit(true);
            result.setEvent("onchange");
            result.setRefreshMode("complete");
            return result;
        }

        private UIComponent createBr3(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspLineBreak result = new XspLineBreak();
            return result;
        }

        private UIComponent createBr4(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspLineBreak result = new XspLineBreak();
            return result;
        }

        private UIComponent createPanel16(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            // loaded=??
            String loadedBnd = "#{javascript:!isMobile()}";
            String sourceId = "panel16/@loaded";
            String loaded = evaluator.evaluateAsString(null, loadedBnd, sourceId, boolean.class);
            if ( null != loaded && loaded.length() > 0 &&
                    ! Boolean.parseBoolean(loaded) ) {
                return null;
            } // else loaded was true
            UIPanelEx result = new UIPanelEx();
            result.setStyleClass("xlFormFooterContainer");
            setId(result, "panel16");
            return result;
        }

        private UIComponent createButton2(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspCommandButton result = new XspCommandButton();
            result.setValue("Save");
            Attr attrs2 = new Attr();
            attrs2.setComponent(result);
            attrs2.setValue("Save Button");
            attrs2.setName("name");
            result.addAttr(attrs2);
            result.setStyleClass("lotusFormButton");
            result.setTitle("Save Button");
            setId(result, "button2");
            return result;
        }

        private UIComponent createEventHandler3(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            XspEventHandler result = new XspEventHandler();
            ActionGroup action = new ActionGroup();
            action.setComponent(result);
            SaveAction actions = new SaveAction();
            actions.setComponent(result);
            String sourceId = "button2/xp:eventHandler[1]/xp:this.action[1]/xp:actionGroup[1]/xp:save[1]/xp:this.name[1]/text()";
            String nameExpr = "#{javascript:\n\t\t\t\t\t\t\t\tvar page = compositeData.gotoPage;\n\t\t\t\t\t\t\t\tif(\"/topicThread.xsp\" == page){\n\t\t\t\t\t\t\t\t\tpage += \"?action=openDocument&documentId=\" + responseDoc.getNoteID();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn(page);}";
            ValueBinding name = evaluator.createValueBinding(result, nameExpr, sourceId,String.class);
            actions.setValueBinding("name", name);
            actions.setSourceReferenceId("button2/xp:eventHandler[1]/xp:this.action[1]/xp:actionGroup[1]/xp:save[1]");
            action.addAction(actions);
            action.setSourceReferenceId("button2/xp:eventHandler[1]/xp:this.action[1]/xp:actionGroup[1]");
            result.setAction(action);
            result.setSubmit(true);
            result.setEvent("onclick");
            result.setRefreshMode("complete");
            return result;
        }

        private UIComponent createLinkcancel(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            // loaded=??
            String loadedBnd = "#{javascript:!isMobile()}";
            String sourceId = "linkCancel/@loaded";
            String loaded = evaluator.evaluateAsString(null, loadedBnd, sourceId, boolean.class);
            if ( null != loaded && loaded.length() > 0 &&
                    ! Boolean.parseBoolean(loaded) ) {
                return null;
            } // else loaded was true
            XspOutputLink result = new XspOutputLink();
            String sourceId2 = "linkCancel/xp:this.value[1]/text()";
            String valueExpr = "#{javascript:\n\t\t\t\t\tvar page = compositeData.gotoPage;\n\t\t\t\t\tif(\"/topicThread.xsp\" == page){\n\t\t\t\t\tpage += \"?action=openDocument&documentId=\" + context.getUrlParameter(\"parentNoteID\");\n\t\t\t\t\t}\n\t\t\t\t\treturn(page);\n\t\t\t\t}";
            ValueBinding value = evaluator.createValueBinding(result, valueExpr, sourceId2,Object.class);
            result.setValueBinding("value", value);
            Attr attrs2 = new Attr();
            attrs2.setComponent(result);
            attrs2.setValue("Cancel Button");
            attrs2.setName("name");
            result.addAttr(attrs2);
            Map<String,Object> attrs = getAttributes(result);
            attrs.put("themeId", "Link.action");
            result.setRole("button");
            result.setTitle("Cancel Button");
            setId(result, "linkCancel");
            result.setText("Cancel");
            return result;
        }

    }
}
